--
-- Description: View for displaying the list of files.
-- Date created: 6 May 2008
--

set ANSI_NULLS on
set QUOTED_IDENTIFIER on
go

--
-- drop the view if it exists and recreate it.
--
if exists
(
	select * 
	from sys.views
	where object_id = OBJECT_ID(N'[dbo].[Files_vw]')
)
begin
	drop view [dbo].[Files_vw]
end
go

create view [dbo].[Files_vw] 
as
    select 
    F.[FileID]
    , F.[FileName]
    , F.[FileVersion]
    , F.[DateCreated]
    , F.[DateModified]
	, PF.[ProductID]
    from [dbo].[Files] F (nolock)
	inner join [dbo].[ProductsFiles] PF (nolock)
		on F.[FileID] = PF.[FileID]
go
